﻿<%
class LinkClass
    public blogId
    public linkId, linkGroupId, linkName, linkUrl, linkDesc, linkImg, displaySeq
    
    public function toArray()
        dim array(8)
        
        array(0) = blogId
        array(1) = linkGroupId
        array(2) = linkId
        array(3) = linkName
        array(4) = linkUrl
        array(5) = linkDesc
        array(6) = linkImg
        array(7) = displaySeq
        
        toArray = array
    end function
    
    public function build(array)
        build = false
        if isEmpty(array) or not isArray(array) then
            exit function
        end if
        if ubound(array)<8 then
            exit function
        end if    
    
        blogId      = array(0) 
        linkGroupId = array(1) 
        linkId      = array(2) 
        linkName    = array(3) 
        linkUrl     = array(4) 
        linkDesc    = array(5) 
        linkImg     = array(6) 
        displaySeq  = array(7) 
            
        build = true
    end function
    
    public function buildFromRS(rs)
        buildFromRS = false
        if isEmpty(rs) or not isObject(rs) then
            exit function
        end if
        if rs.bof or rs.eof then
            exit function
        end if    
        
        linkId      = rs("link_id")
        
        on error resume next
        
        blogId      = rs("blog_id")
        linkGroupId = rs("link_group")
        linkName    = rs("link_name") 
        linkUrl     = rs("link_url") 
        linkDesc    = rs("link_desc")
        linkImg     = rs("link_img")
        displaySeq  = rs("display_seq")
        
        on error goto 0
        
        buildFromRS = true    
    end function
end class

%>